package service.impl;

import core.Page;
import dao.ISignInDao;
import domain.SignRecord;
import service.ISignInService;

import java.sql.SQLException;
import java.util.List;

public class SignInServiceImpl implements ISignInService {
     private final ISignInDao signInDao;
     public SignInServiceImpl(ISignInDao signInDao) {
        this.signInDao = signInDao;


    }

    @Override
    public int addSignRecord(SignRecord signRecord) throws SQLException {
        return signInDao.addSignRecord(signRecord);
    }

    @Override
    public Page<SignRecord> selectSignRecord(SignRecord signRecord) throws SQLException {
        Page<SignRecord> page = new Page<>();
        page.setRecords(signInDao.selectSignRecord(signRecord));
        page.setTotal(signInDao.selectTotal(signRecord));
        return page;
    }
}
